﻿@model DiffPlex.DiffBuilder.Model.DiffPiece
@using DiffPlex.DiffBuilder.Model
@if (!string.IsNullOrEmpty(Model.Text))
{
    string spaceValue = "\u00B7";
    string tabValue = "\u00B7\u00B7";
    if (Model.Type == ChangeType.Deleted || Model.Type == ChangeType.Inserted || Model.Type == ChangeType.Unchanged)
    {
    @Html.Raw(Html.Encode(Model.Text).Replace(" ", spaceValue).Replace("\t", tabValue))
    }
    else if (Model.Type == ChangeType.Modified)
    {
        foreach (var character in Model.SubPieces)
        {
            if (character.Type != ChangeType.Imaginary)
            {               
    <span class="@Html.Raw(character.Type.ToString())Character">
        @Html.Raw(Html.Encode(character.Text.Replace(" ", spaceValue.ToString())))</span>
            }
        }
    }

}
